package lab01;

import java.util.Scanner;

/**
 * Created by Administrator on 2017/12/26.
 */
public class Test08_1 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入一个1--100的整数   i=");
        int j=(int) (Math.random() * 100)+1;
        System.out.println(j);
       while (true){
        int i=scanner.nextInt();
        if (i>j){
            System.out.println("猜大了");
        }
                else if (i<j){
            System.out.println("猜小了");
        }
        else  {
            System.out.println("猜对了");
            break;
        }
    }
}}
